//
//  LJFPeopleSearchCollectionViewCell.m
//  GiftThat
//
//  Created by 刘景峰 on 16/1/9.
//  Copyright © 2016年 ChuXiang. All rights reserved.
//

#import "LJFPeopleSearchCollectionViewCell.h"

@implementation LJFPeopleSearchCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame{
     self = [super initWithFrame:frame];
    if (self) {
        self.label = [UILabel new];
        self.label.layer.cornerRadius = 5;
        self.label.layer.masksToBounds = YES;
        self.label.layer.borderWidth = 0.5f;
//        self.label.layer.borderColor = [UIColor grayColor].CGColor;
        [self.label setFont:[UIFont fontWithName:@"FZLanTingHei-EL-GBK" size:13]];
        
        self.label.textAlignment = NSTextAlignmentCenter;
//        self.label.backgroundColor = [UIColor yellowColor];
        [self.contentView addSubview:self.label];
    }
    return self;
}

-(void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes{
    self.label.frame = CGRectMake(10, 5, self.width - 20, self.height - 10);
}

-(void)setString:(NSString *)string{

    self.label.text = string;
    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"Color"] isEqualToString:@"BlackColor"]) {
        self.label.backgroundColor = [UIColor blackColor];
        self.label.textColor = [UIColor whiteColor];
        self.label.layer.borderColor = [UIColor whiteColor].CGColor;

    }else{
        self.label.backgroundColor = [UIColor whiteColor];
        self.label.textColor = [UIColor blackColor];
        self.label.layer.backgroundColor = [UIColor blackColor].CGColor;
        
    }

    
}

@end
